var noWlCustomer;
var selectWlCustomerIDs;
var oldFloatWlCustomer;
var selectWlCustomerInRow;
var ifMultWlCustomer=0;
function selectWlCustomer(myID,inrow,WlCustomerColNo,ifMultWlCustomer,e){
	var floath=e.screenY-window.screen.availHeight+document.body.clientHeight+30;
	if(floath+255>document.body.clientHeight)floath=floath-255;
	var floatw=e.screenX;
	if(e.screenX+505>document.body.clientWidth)floatw=floatw-500;
		selectWlCustomerInRow=inrow;
		noWlCustomer=WlCustomerColNo;
		selectWlCustomerIDs=myID;
		//ifMult=ifMults;
		
		oldFloatWlCustomer = dijit.byId("selectWlCustomerFloat_1");
		if(oldFloatWlCustomer==undefined){
			var div = dojo.doc.createElement('div');
			dojo.body().appendChild(div);
			var fp = new dojox.layout.FloatingPane({id:"selectWlCustomerFloat_1",title:"????????",
				maxable: true,closable: true,resizable: true ,dockable:true,
				href:"../common/selectWlCustomerFloat.html"},div);
			dojo.style(fp.domNode,{
				width:"500px",height:"255px",top:floath, left:floatw,position:"absolute",zIndex:"980"});
			oldFloatWlCustomer=fp;
			fp.startup();
			fp.show();
			
		}else{
			dojo.style(oldFloatWlCustomer.domNode,{width:"500px",height:"255px",
				top:floath, left:floatw,
				position:"absolute",zIndex:"980"});
			oldFloatWlCustomer.show();
		}
}
function WlCustomerVOJs(){
   this.customerName
   ; this.relation
   ; this.id
   ; this.juridicalPerson
   ; this.enrolDate
   ; this.enrolFund
   ; this.taxResisterNo
   ; this.bank
   ; this.acountNO
   ; this.linkman
   ; this.headTel
   ; this.tel
   ; this.mobil
   ; this.email
   ; this.fax
   ; this.peopleCode
   ; this.peopleName
   ; this.passWord
   ; this.value
   ; this.address
   ; this.place
   ; this.parentCustomerID
   ; this.customerStatus
   ; this.customerSort
   ; this.people

}
function WlCustomerVOtoArray_fun(ulvo,edit){//new!!!!!
            var querydata=new Array();
            var items = new Array();
            var ul=new Array();
            var ulo="";
            var le="";
            var d="",t;
            var arraytag="0";//isArray
            if(ulvo!=null){
              if(ulvo.length==undefined){
                 ul[0]=ulvo;
                 arraytag="1";
                 le=1;
              }else{
                 ul=ulvo;
                 le=ul.length;
              }        
              if(edit==false){
                    for(var i = 0; i < le; i++){		
                        items = new Array();
                        ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        
                        items[2] = ulo["ns:customerName"];//
                        items[3] = ulo["ns:juridicalPerson"];//
                        t=ulo["ns:enrolDate"];if(t!=null&&t!=undefined){items[4] = t['ns:upDate'];}
                        t=ulo["ns:enrolFund"];if(t!=null&&t!=undefined){items[5] =  t['ns:upNumber'];}
                        items[6] = ulo["ns:taxResisterNo"];//
                        items[7] = ulo["ns:bank"];//
                        items[8] = ulo["ns:acountNo"];//
                        items[9] = ulo["ns:linkman"];//
                        items[10] = ulo["ns:headTel"];//
                        items[11] = ulo["ns:tel"];//
                        items[12] = ulo["ns:mobil"];//
                        items[13] = ulo["ns:email"];//
                        items[14] = ulo["ns:fax"];//
                        items[15] = ulo["ns:relation"];//
                        items[16] = ulo["ns:peopleCode"];//
                        items[17] = ulo["ns:peopleName"];//
                        items[18] = ulo["ns:passWord"];//
                        items[19] = ulo["ns:value"];//
                        items[20] = ulo["ns:address"];//
                        //t=ulo["ns:parentCustomerID"];if(t!=null&&t!=undefined){items[21] =  t['ns:upNumber'];}
						items[21]=WlCustomerVOtoArray_fun(ulo["ns:parentCustomerID"],edit);
                        items[22] = ulo["ns:customerStatus"];//
                        items[23] = ulo["ns:customerSort"];//
                         items[24] = PeopleVOtoArray_fun(ulo["ns:people"],edit);
                         items[25] = WlPlaceVOtoArray_fun(ulo["ns:place"],edit);
                      if(arraytag=="0"){
                        querydata[i]=items;
                      }else{
                        querydata=items;
                      }
                    }
                  }else{//edit==true
                    for(var i = 0; i < le; i++){		
                        items = new Array();
                        ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        
                        items[2] = ulo["ns:customerName"];//
                        items[3] = ulo["ns:juridicalPerson"];//
                        t=ulo["ns:enrolDate"];if(t!=null&&t!=undefined){
                        d=dojo.date.locale.parse(new String( t['ns:upDate']),{datePattern: "yyyy-MM-dd",timePattern:"HH:mm" });}
                        items[4] = d;
                        items[5] = d;                        
                        t=ulo["ns:enrolFund"];if(t!=null&&t!=undefined){items[6] =  t['ns:upNumber'];}
                        items[7] = ulo["ns:taxResisterNo"];//
                        items[8] = ulo["ns:bank"];//
                        items[9] = ulo["ns:acountNo"];//
                        items[10] = ulo["ns:linkman"];//
                        items[11] = ulo["ns:headTel"];//
                        items[12] = ulo["ns:tel"];//
                        items[13] = ulo["ns:mobil"];//
                        items[14] = ulo["ns:email"];//
                        items[15] = ulo["ns:fax"];//
                        items[16] = ulo["ns:relation"];//
                        items[17] = ulo["ns:peopleCode"];//
                        items[18] = ulo["ns:peopleName"];//
                        items[19] = ulo["ns:passWord"];//
                        items[20] = ulo["ns:value"];//
                        items[21] = ulo["ns:address"];//
                        //t=ulo["ns:parentCustomerID"];if(t!=null&&t!=undefined){items[22] =  t['ns:upNumber'];}
						items[22]=WlCustomerVOtoArray_fun(ulo["ns:parentCustomerID"],edit);
                        items[23] = ulo["ns:customerStatus"];//
                        items[24] = ulo["ns:customerSort"];//
                         items[25] = PeopleVOtoArray_fun(ulo["ns:people"],edit);
                         items[26] = WlPlaceVOtoArray_fun(ulo["ns:place"],edit);
                      if(arraytag=="0"){
                        querydata[i]=items;
                      }else{
                        querydata=items;
                      }
                    }
                  } 
            }//!=null                     
            return querydata;
}
 

function WlCustomerVOtoArray_fun_old(ulvo,edit){
            var querydata=new Array();
            var items = new Array();
            var ul=new Array();
            var ulo="";
            var le="";
            var d="",t;
            var arraytag="0";//isArray
            if(ulvo!=null){
              if(ulvo.length==undefined){
                 ul[0]=ulvo;
                 arraytag="1";
                 le=1;
              }else{
                 ul=ulvo;
                 le=ul.length;
              }        
              if(edit==false){
                    for(var i = 0; i < le; i++){		
                        items = new Array();
                        ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        
                        items[2] = ulo["ns:customerName"];//
                        items[3] = ulo["ns:juridicalPerson"];//
//????????????//
                        t=ulo["ns:enrolFund"];if(t!=null&&t!=undefined){items[4] =  t['ns:upNumber'];}
                        items[5] = ulo["ns:taxResisterNo"];//
                        items[6] = ulo["ns:bank"];//
                        items[7] = ulo["ns:acountNo"];//
                        items[8] = ulo["ns:linkman"];//
                        items[9] = ulo["ns:headTel"];//
                        items[10] = ulo["ns:tel"];//
                        items[11] = ulo["ns:mobil"];//
                        items[12] = ulo["ns:email"];//
                        items[13] = ulo["ns:fax"];//
                        items[14] = ulo["ns:relation"];//
                        items[15] = ulo["ns:peopleCode"];//
                        items[16] = ulo["ns:peopleName"];//
                        items[17] = ulo["ns:passWord"];//
                        items[18] = ulo["ns:value"];//
                        items[19] = ulo["ns:address"];//
						items[20] =WlCustomerVOtoArray_fun(ulo["ns:parentCustomerID"],edit);
						items[21] = ulo["ns:customerStatus"];//
                        items[22] = ulo["ns:customerSort"];//
//----------begin
                        t=ulo["ns:enrolDate"];if(t!=null&&t!=undefined){items[23] = t['ns:upDate'];}
//----------end--
                         items[24] = PeopleVOtoArray_fun(ulo["ns:people"],edit);
                         items[25] = WlPlaceVOtoArray_fun(ulo["ns:place"],edit);
                      if(arraytag=="0"){
                        querydata[i]=items;
                      }else{
                        querydata=items;
                      }
                    }
                  }else{//edit==true
                    for(var i = 0; i < le; i++){		
                        items = new Array();
                        ulo=ul[i];
                        items[0] = false;
                        items[1] = ulo["ns:id"];
                        
                        items[2] = ulo["ns:customerName"];//
                        items[3] = ulo["ns:juridicalPerson"];//
//??????????//
                        t=ulo["ns:enrolFund"];if(t!=null&&t!=undefined){items[4] =  t['ns:upNumber'];}
                        items[5] = ulo["ns:taxResisterNo"];//
                        items[6] = ulo["ns:bank"];//
                        items[7] = ulo["ns:acountNo"];//
                        items[8] = ulo["ns:linkman"];//
                        items[9] = ulo["ns:headTel"];//
                        items[10] = ulo["ns:tel"];//
                        items[11] = ulo["ns:mobil"];//
                        items[12] = ulo["ns:email"];//
                        items[13] = ulo["ns:fax"];//
                        items[14] = ulo["ns:relation"];//
                        items[15] = ulo["ns:peopleCode"];//
                        items[16] = ulo["ns:peopleName"];//
                        items[17] = ulo["ns:passWord"];//
                        items[18] = ulo["ns:value"];//
                        items[19] = ulo["ns:address"];//
						items[20] =WlCustomerVOtoArray_fun(ulo["ns:parentCustomerID"],edit);
						items[21] = ulo["ns:customerStatus"];//
                        items[22] = ulo["ns:customerSort"];//
                        t=ulo["ns:enrolDate"];if(t!=null&&t!=undefined){
                        d=dojo.date.locale.parse(new String( t['ns:upDate']),{datePattern: "yyyy-MM-dd",timePattern:"HH:mm" });}
                        items[23] = d;
                        items[24] = d;                        
                         items[25] = PeopleVOtoArray_fun(ulo["ns:people"],edit);
                         items[26] = WlPlaceVOtoArray_fun(ulo["ns:place"],edit);
                      if(arraytag=="0"){
                        querydata[i]=items;
                      }else{
                        querydata=items;
                      }
                    }
                  } 
            }//!=null                     
            return querydata;
}
